package com.zhuifeng.smart.services.impl;

import com.zhuifeng.smart.dao.UserDao;
import com.zhuifeng.smart.daoimpl.UserDaoImpl;
import com.zhuifeng.smart.model.User;
import com.zhuifeng.smart.services.UserServices;

public class UserServicesImpl implements UserServices {
	private UserDao userDao;

	public UserServicesImpl() {
		userDao = new UserDaoImpl();
	}

	@Override
	public User login(String userAccount, String userPassword) {
		return userDao.getUser(userAccount, userPassword);
	}

	@Override
	public User register(User user) {
		// TODO Auto-generated method stub
		return userDao.addUser(user);
	}

	@Override
	public boolean isHaveUser(String userAccount) {
		// TODO Auto-generated method stub
		return userDao.getUser(userAccount) != null;
	}

}
